package edu.pku.hawk.controller.util;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class MInputStreamQueue extends MQueue{

	private InputStream inputStream;
	
	
	public MInputStreamQueue(String queueName, InputStream inputStream) {
		super(queueName, null);
		this.inputStream = inputStream;
	}
	
	public void receive(OutputStream os) throws IOException {
		if (os != null && inputStream != null) {
			int b;
			while((b = inputStream.read()) != -1) {
				os.write(b);
			}
		}
	}
	
}
